package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;

public class CopyDemo {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("./img.png");
        FileOutputStream fos = new FileOutputStream("./img_cp.png");
        int d;
        long start = System.currentTimeMillis();
        while ((d = fis.read()) != -1) {
            fos.write(d);
        }
        long end = System.currentTimeMillis();
        System.out.println("耗时:"+(end - start)+"ms");
        System.out.println("复制完毕");
    }
}
